import cv2 as cv
import sys

cap = cv.VideoCapture('assets/my_video.avi')
if not cap.isOpened():
    print("视频文件打开失败！")
    sys.exit(1)

fps = cap.get(cv.CAP_PROP_FPS)
size = (int(cap.get(cv.CAP_PROP_FRAME_WIDTH)),
        int(cap.get(cv.CAP_PROP_FRAME_HEIGHT)))
print(fps, size)

success, frame = cap.read()
while success:
    cv.imshow("video", frame)
    success, frame = cap.read()
    cv.waitKey(50)
